import {
	mapGetters,
	mapState
} from "vuex";
import { setshare } from '@/api/store';
export default {
	data() {},
	methods: {},
	computed: {
		...mapGetters([
			"isLogin",
			"themeName",
			"themeColor",
			"userInfo",
			"appConfig",
		]),
	},
	// 全局配置分享
	onShareAppMessage() {
		const {
			share_image,
			share_intro,
			share_title
		} = this.appConfig;
		const {
			code
		} = this.userInfo;
		const share = {
			title: share_title,
			path: `/pages/index/index?invite_code=${code}`,
			imageUrl: share_image,
		};
		setshare().then(res => {
			console.log('分享得积分')
		});
		return share;
	},
	onShareTimeline() {
		const {
			share_image,
			share_intro,
			share_title
		} = this.appConfig;
		const {
			code
		} = this.userInfo;
		const share = {
			title: share_title,
			imageUrl: share_image,
		};
		setshare().then(res => {
			console.log('分享得积分')
		});
		return share;
	},
};